home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’91 / DAL Files / DALtool 4⁄19 (System 6.x) / CL1API.H next >
Text File  |  1990-11-12  |  5KB  |  152 lines

  1.  
  2. /*
  3.       CL/1  API include file
  4.          
  5.       Copyright © 1986, 1987, 1989, 1989, 1990 Network Innovations Corporation.
  6.     All Rights Reserved.
  7.     CL/1 is a trademark of Network Innovations Corporation.
  8.     This software may not be used without permission from
  9.     Network Innovations Corporation.
  10. */
  11.  
  12.    /* Client environment - define the correct one to 1, set the rest to 0 */
  13.  
  14. #define CL1MACDVR 1
  15. #define CL1MSDTSR 0
  16. #define CL1WINDLL 0
  17. #define CL1OS2DLL 0
  18.  
  19.    /* CL/1  API function return values */
  20.  
  21. #define A_NULL       1      /* null value returned */
  22. #define A_OK         0        /* requested API function completed successfully */
  23. #define A_VALUE      0      /* data value returned */
  24. #define A_ERROR     -1      /* execution error occurred */
  25. #define A_READY     -2      /* execution completed successfully */
  26. #define A_BADTYPE   -3      /* data type mismatch */
  27. #define A_BADCOL    -4      /* request for non-existent column */
  28. #define A_BREAK     -5      /* user's break function was called and it returned true */
  29. #define A_EXEC      -6      /* the host is "busy" executing the requested statements */
  30. #define A_NOTCONN   -7      /* a function failed because the connection has not been made */
  31.    
  32.    /* additional return values from CLConInfo */
  33.    
  34. #define A_SESSMAX   -8      /* the specified session id number is too high */
  35. #define A_INUSE     -9      /* the session is in use by another (client) program */
  36. #define A_NOHOST   -10      /* the session open, but has not connected to a host */
  37.  
  38.    /* CL/1  API data type codes */
  39.  
  40. #define A_DISCARD  -1       /* discard next value */
  41. #define A_NONE      0       /* check status, do not get a value */
  42.  
  43. #define A_BOOLEAN   1       /* boolean data type */
  44. #define A_SMINT     2       /* short integer data type */
  45. #define A_INTEGER   3       /* long integer data type */
  46. #define A_SMFLOAT   4       /* single-precision f/p data type */
  47. #define A_FLOAT     5       /* double-precision f/p data type */
  48. #define A_DATE      6       /* date data */
  49. #define A_TIME      7       /* time data */
  50. #define A_TIMESTAMP 8       /* date & time data */
  51. #define A_CHAR      9       /* fixed-length character type */
  52. #define A_DECIMAL  10       /* packed decimal data type */
  53. #define A_MONEY    11       /* money data type (packed dec) */
  54. #define A_VCHAR    12       /* variable-length character type */
  55. #define A_VBIN     13       /* variable-length binary type */
  56. #define A_LCHAR    14       /* long text data type */
  57. #define A_LBIN     15       /* long binary data type */
  58. #define A_ANYTYPE  64       /* any type */
  59.  
  60.    /* CL/1 column values */
  61.    
  62. #define A_NXTCOL   -1      /* next column */
  63.  
  64.    /* CL/1  API flags bits */
  65.  
  66. #define AF_RECEND   1
  67. #define AF_FMTOUT   2
  68. #define AF_ISNULL   4
  69.  
  70.    /* CL/1  wait time values (>= 0 is hundredths of secs) */
  71.    
  72. #define AW_FOREVER -1
  73. #define AW_DEFAULT -2
  74.  
  75.    /* CL/1  API function prototypes */
  76.    
  77. #ifdef PROTOTYPE
  78. extern CLInit (long*,char*,char*,char*,char*);
  79. extern CLEnd (long);
  80. extern CLGetErr (long,long*,long*,char*,char*,char*);
  81. extern CLState (long);
  82. extern CLBreak (long,int);
  83.  
  84. extern CLSend (long,char*,int);
  85. extern CLSendItem (long,int,int,int,int,char*);
  86. extern CLExec (long);
  87.  
  88. extern CLConInfo (long,int,long*,long*,char*,char*,char*,char*,long*,long*);
  89. extern CLGetSn (long);
  90.  
  91. extern CLUngetItem (long);
  92. extern CLGetItem (long,int,short*,short*,short*,short*,char*);
  93.  
  94. extern cl1open (long*);
  95. extern cl1api (struct cl1CB *);
  96. #endif
  97.  
  98.    /* Define the msdos keyword far to nothing for mac and others */
  99.  
  100. #ifndef far
  101. # if ! CL1MSDTSR && ! CL1WINDLL && ! CL1OS2DLL
  102. #  define far /* ! */
  103. # endif
  104. #endif
  105.  
  106. #ifndef LOCAL
  107. # if CL1OS2DLL
  108. #  define LOCAL static
  109. # else
  110. #  define LOCAL /* ! */
  111. # endif
  112. #endif
  113.  
  114.    /****************************************************/
  115.    /* CL/1  API control block -  struct cl1CB          */
  116.    /* Supplied only for use by the glue source itself, */
  117.    /* in order to be able to compile the glue.         */
  118.    /* Please use CL/1 thru the glue functions only,    */
  119.    /* and not thru the  cl1api ()  interface.          */
  120.    /****************************************************/
  121.  
  122. struct cl1CB {
  123.    char far *buffer;       /* in : ptr to read/write buffer or 0 */
  124.  
  125.    short retstatus;        /* out: return status code */
  126.    short colnum;           /* internal */
  127.    short cl1type;          /* in : type expected, out: actual type */
  128.    short len;              /* in : length of buffer, out: length of data */
  129.  
  130.    short places;           /* out: places in packed decimal data */
  131.    short flags;            /* in/out: data flags */
  132.    short request;          /* in : function request */
  133.    short timeout;          /* in : function timeout */
  134.  
  135.    long  versid;           /* out: version id of CL/1 client */
  136.    long  sttime;           /* out: session ident value */
  137.    long  sessid;           /* in/out: session id */
  138.    long  sesdat;           /* in/out: ptr to session specific data */
  139.  
  140.    long  exlon0;           /* reserved */
  141.    long  exinf0;           /* reserved */
  142.    long  exinf1;           /* internal */
  143.    long  exinf2;           /* internal */
  144.  
  145.    char far *exinf3;       /* internal */
  146.    char far *exinf4;       /* internal */
  147.    char far *exinf5;       /* internal */
  148.    char far *exinf6;       /* internal */
  149.    char far *exinf7;       /* reserved */
  150. };
  151.  
  152.